package com.xja.service.impI;

import com.xja.entity.House;
import com.xja.mapper.HouseMapper;
import com.xja.mapper.HtypeMapper;
import com.xja.service.HouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service("houserService")
public class HouseServiceImpI implements HouseService {
    @Autowired
    private HouseMapper houseMapper;
    @Autowired
    private HtypeMapper htypeMapper;

    public List<House> findHouseByPage(Map<String, Object> resuMap) {
        List<House> houseByPage = houseMapper.findHouseByPage(resuMap);
        return houseByPage;
    }
//detail.jsp

    public Map<String, Object> getOne(Integer id) {
        Map<String,Object> stringObjectHashMap=new HashMap<String, Object>();
        stringObjectHashMap.put("house",houseMapper.selectByPrimaryKey(id));
        stringObjectHashMap.put("type",htypeMapper.selectByExample(null));
        return stringObjectHashMap;
    }

}
